package com.example.ViewPagerSum.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by wangjing on 2015/9/9at0:00.
 * <p/>
 * Email:wjontheway@163.com
 * <p/>
 * ViewPagerSum
 */
public class HomeFragmentAdapter extends FragmentPagerAdapter {
    private List<Fragment> list;
    public HomeFragmentAdapter(FragmentManager fm,List<Fragment> list) {
        super(fm);
        this.list=list;
    }

    @Override
    public Fragment getItem(int position) {
        return list.get(position);
    }

    @Override
    public int getCount() {
        return list==null?0:list.size();
    }
}
